package main

import (
	"Ginproject/GinProject/OtherDataFormat/src"
	"github.com/gin-gonic/gin"
	"net/http"
	"time"
)

func main() {
	router := gin.Default()

	//Arouter.LoadHTMLGlob("template/**/*")
	router.Static("/static", "/static")

	router.GET("/outjson", src.OutJson)
	router.GET("/outjson2", src.UserInfo)
	router.GET("/outAscii", src.OutAsciiJSON)
	router.GET("/outJsonp", src.OutJsonP)
	router.GET("/outpurejson", src.OutPureJson)
	router.GET("/outsecurejson", src.SecureJSON)
	router.GET("/outxml", src.OutXml)
	router.GET("/outyxml", src.OutYaml)
	router.GET("/outproto", src.OutProto)

	router.GET("/redirect_a", src.RedirectA)
	router.GET("/redirect_b", src.RedirectB)

	/*
		自定义http配置
	*/
	//Arouter.Run(":8080")
	//http.ListenAndServe(":8080", Arouter)
	s := &http.Server{
		Addr:         ":8080",
		Handler:      router,
		ReadTimeout:  10 * time.Second,
		WriteTimeout: 5 * time.Second,
	}

	s.ListenAndServe()
}
